const express = require("express")
const expressJoi =require("@escook/express-joi")
const router = express()
const {reg__addCate_schema, reg_deleteCate_schema,reg_updateAct_schema} = require("../usershem")
//router 处理函数模块分离
const routerHander = require("../router_hander")

//获取文章
router.get("/cate",routerHander.getActive)

//添加文章分类
router.post("/addcate",expressJoi(reg__addCate_schema),routerHander.addcate)

//删除文章
router.post("/delete/:id",expressJoi(reg_deleteCate_schema),routerHander.deleteCate)

//查询文章详情
router.post("/cateinfo/:id",expressJoi(reg_deleteCate_schema),routerHander.getcateInfo)

//更新文章
router.post("/updateact",expressJoi(reg_updateAct_schema),routerHander.updateAct)



module.exports=router